Skip to content

Conversation

@pettyjamesm
Copy link
Member

Description

Fixes 15931 which was introduced in #15721 and could cause split assignment updates that are empty after filtering previously acknowledged splits to trigger a sanity check validation in DriverSplitRunnerFactory#enqueueSplits and fail.

This change should not require release notes because the issue being fixed has not yet shipped with a release.

Release notes

(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

Copy link
Member

@JunhyungSong JunhyungSong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % comments

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not to reschedule when numSplits <= guaranteedSplitsPerRequest already?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, or any other situation where the new batch size would still allow sending the number of splits that we have for the current request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be a bug(other than numSplits <= guaranteedSplitsPerRequest). Because if requestSize > maxRequestSizeInBytes and newSplitBatchSize < currentSplitBatchSize, it should be numSplits <= guaranteedSplitsPerRequest || numSplits > newSplitBatchSize. Otherwise, that would mean that the split batch size decreasing logic is not working as expected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you're correct, but it seems more clear to make the check explicit and also handle numSplits < guaranteedSplitsPerRequest no? I'm happy to just drop this commit since the first one is already merged with the bugfix too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useful. My thought is that it would be better to have something like checkState(numSplits > newSplitBatchSize || numSplits <= guaranteedSplitsPerRequest, "numSplits is not adjusted"); inside if (newSplitBatchSize < currentSplitBatchSize) { ... }.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, updated with that additional check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we were wrong about that numSplits assumption: the new batch size can be smaller than the old batch size even though numSplits <= newSplitBatchSize. I've pushed a new revision which updates the check to only reschedule when numSplits > newSplitBatchSize && requestSize > maxRequestSizeInBytes since that's logically the intention here.

Copy link
Member

@JunhyungSong JunhyungSong Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new batch size can be smaller than the old batch size even though numSplits <= newSplitBatchSize.

I see that this can happen when requestSize < expectedSize && currentSplitBatchSize < maxUnacknowledgedSplits and currentSplitBatchSize > newSplitBatchSize. Good catch.

@arhimondr
Copy link
Contributor

It looks like the second commit requires more discussion while the first one is ready to go. I'm going to pull the first commit in separately to unblock the release.

@arhimondr
Copy link
Contributor

First commit merged, this should unblock the release. Thanks @pettyjamesm , @JunhyungSong

@pettyjamesm pettyjamesm force-pushed the fix-splitassignment-filtering branch 2 times, most recently from 9da72e4 to 8a2698d Compare February 3, 2023 19:18
@pettyjamesm pettyjamesm force-pushed the fix-splitassignment-filtering branch from 8a2698d to eb7a68c Compare February 7, 2023 15:39
Copy link
Member

@JunhyungSong JunhyungSong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arhimondr arhimondr merged commit 0954991 into trinodb:master Feb 8, 2023
@github-actions github-actions bot added this to the 407 milestone Feb 9, 2023
@pettyjamesm pettyjamesm deleted the fix-splitassignment-filtering branch February 9, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

io.trino.testing.QueryFailedException: cannot unset noMoreSplits

3 participants